package com.example.dailyrecord.entity;

public enum StatusCode {
    SUCCESS(200, "请求成功"),
    MAIL_SEND_SUCCESS(201, "邮件发送成功"),
    MAIL_REGISTERED(202, "此邮箱已被注册，请尝试其他邮箱或者直接登录"),
    REGISTER_SUCCESS(203, "注册成功"),
    LOGIN_SUCCESS(204, "登陆成功"),
    UPDATE_PASS_SUCCESS(205, "密码修改成功"),
    FAIL(400, "请求失败"),
    MAIL_SEND_LOT(401, "邮件发送频繁，请稍后再试"),
    PASS_WRONG(402, "用户名或密码错误"),
    CODE_WRONG(403, "验证码错误"),
    CODE_INVALID(404, "验证码失效"),
    USER_NOT_EXIST(405, "用户不存在"),
    USER_ALREADY_EXIST(406, "用户已存在"),
    ACCOUNT_LOCK(407, "密码输入次数大于三次，账户锁定1小时"),
    TOKEN_INVALID(408, "还未登录，请先登录"),
    NOT_FINISHED(409, "还有日志未完成，请先完成之前的日志"),
    ;

    private final int code;
    private final String message;

    StatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
